package com.qsmx.qingqiuticket.app.banner;

import android.view.View;

import androidx.appcompat.widget.AppCompatImageView;

import com.bigkoo.convenientbanner.holder.Holder;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.qsmx.core.app.Atmos;
import com.qsmx.qingqiuticket.app.R;

/**
 * @ClassName: ImageHolder
 * @Description: java类作用描述
 * @Author: Jove.Nan
 * @Date: 2019/3/18 5:45 PM
 */
public class ImageHolder extends Holder<String> {

    private AppCompatImageView mImageView;

    public ImageHolder(View itemView) {
        super(itemView);
    }

    @Override
    protected void initView(View itemView) {
        mImageView = itemView.findViewById(R.id.img_single);
    }

    @Override
    public void updateUI(String data) {
        Glide.with(Atmos.getApplicationContext())
                .load(data)
                .diskCacheStrategy(DiskCacheStrategy.ALL)
                .placeholder(R.mipmap.default_load_pic)
                .into(mImageView);
    }
}
